<div class="page-header">
    <h2>Photo-gallery</h2>
    <?php if($auth_user) :?>
        <?=HTML::anchor("login", __('Go to Admin'))?>
    <?php else : ?>
        <?=HTML::anchor("login", __('Login to Admin'))?>
    <?php endif; ?>
</div>


<?if($images->count() > 0):?>
    <div class="span3"></div>
    <div class="span6">
        <div class="wrapper">
            <div id="gallery">
                <ul class="thumbnails">
                    <li>
                    <?foreach($images as $i => $image):?>
                    <div>
                        <?=HTML::anchor(Model_Image::DIRECTORY_PATH.$image->name,
                            HTML::image(Model_Image::DIRECTORY_PATH."small_".$image->name), array('class' => 'thumbnail fancybox', 'title' => $image->text))?>
                    </div>
                        
                    <? if (($i+1) % 4 == 0 AND $images->count() > ($i+1)) : ?>
                    </li>
                    <li>
                    <?endif; ?>
                    <?endforeach?>
                    </li>
                </ul>
            </div>
            <a href="javascript:void(0);" class="prev">&lsaquo;</a>
            <a href="javascript:void(0);" class="next">&rsaquo;</a>
        </div>
        
    </div>  
    <div class="span3"></div>
<?else:?>
    <p class="text-warning">No images</p>
<?endif?>
